<page-header  [autoTitle]="false"></page-header>
<nz-card>
  <nz-tabset>
    <nz-tab [nzTitle]="'基本信息'">
      <nz-spin *ngIf="isLoading" class="modal-spin"></nz-spin>
      <form nz-form *ngIf="!isLoading" [formGroup]="validateForm" (ngSubmit)="submitForm()">
        <nz-form-item>
          <nz-form-label [nzSpan]="4" nzRequired nzFor="name">姓名</nz-form-label>
          <nz-form-control [nzSpan]="16" [nzValidateStatus]="validateForm.controls['name']">
            <input type="text" nz-input formControlName="name" placeholder="姓名">
            <nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').hasError('required')">请输入姓名
            </nz-form-explain>
            <nz-form-explain *ngIf="validateForm.get('name').dirty && validateForm.get('name').hasError('maxlength')">
              不能超过30个字
            </nz-form-explain>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="4" nzRequired nzFor="role">角色</nz-form-label>
          <nz-form-control [nzSpan]="16" [nzValidateStatus]="validateForm.controls['role']">
            <span>{{entity.role | userRolePipe}}</span>
            <!--<nz-select formControlName="role" [nzPlaceHolder]="'角色'" nzDisabled>
              <nz-option
                *ngFor="let option of userRoleOption"
                [nzLabel]="option.value"
                [nzValue]="option.key">
              </nz-option>
            </nz-select>-->
            <nz-form-explain *ngIf="validateForm.get('role').dirty && validateForm.get('role').hasError('required')">请选择角色
            </nz-form-explain>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item>
          <nz-form-label [nzSpan]="4" nzFor="email">邮箱</nz-form-label>
          <nz-form-control [nzSpan]="16">
            <input type="text" nz-input formControlName="email" placeholder="邮箱">
            <nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').hasError('email')">
              邮箱格式不正确
            </nz-form-explain>
          </nz-form-control>
        </nz-form-item>

        <div nz-form-item nz-row>
          <div nz-col [nzOffset]="7" [nzSpan]="12" nz-form-control>
            <button nz-button type="submit" [nzType]="'primary'">保存</button>
          </div>
        </div>
      </form>
    </nz-tab>
    <nz-tab [nzTitle]="'修改登录密码'">
      <reset-password [businessService]="userService"></reset-password>
    </nz-tab>
    <nz-tab [nzTitle]="'修改操作密码'">
      <reset-password [businessService]="triggerService"></reset-password>
    </nz-tab>
  </nz-tabset>
</nz-card>
